package lab02.test25;

import java.util.Scanner;

public class Test25 {
    public static void main(String[] args) {
        //数字转换的异常处理。输入两个数，计算两个数想除的结果（考虑除数为0的异常情况）。

        int num = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入被除数:");
        int num1 = scanner.nextInt();
        System.out.print("请输入除数:");
        int num2 = scanner.nextInt();

        try{
            num = num1 / num2;
            System.out.println(num);
        }catch(ArithmeticException e) {
            System.out.println("错误：除数不能为0！");
        }finally {
        }

    }
}
